#include "../header/common.h"
#define MAXSOUNDS 6

void play(int mode)
{
  int i;
  Mix_Chunk *sound[MAXSOUNDS];		
  sound[1] = Mix_LoadWAV("sound/background.wav");
  sound[2] = Mix_LoadWAV("sound/menubackground.wav");
  sound[3] = Mix_LoadWAV("sound/go.wav");
  sound[4] = Mix_LoadWAV("sound/cheer.wav");
  sound[5] = Mix_LoadWAV("sound/burn.wav");
    
  if(mode>0)
    {
     Mix_PlayChannel(-1, sound[mode], 0);
    }
  if(mode==0)
    {
      Mix_HaltChannel(-1);
      for(i=1;i<MAXSOUNDS;i++)if(sound[i]!=NULL)Mix_FreeChunk(sound[i]);
    }
}
